// 5. ⾃定义类型
// ⾃定义类型，可以更灵活的限制类型
enum Gender {
    Male,
    Female
}

// ⾃定义⼀个年级类型（⾼⼀、⾼⼆、⾼三）
type Grade = 1 | 2 | 3

// ⾃定义⼀个学⽣类型
type Student = {
    name: string,
    age: number,
    gender: Gender,
    grade: Grade
}

// 定义两个学⽣变量：s1、s2
let s1: Student
let s2: Student

s1 = {name: '张三', age: 98, gender: Gender.Male, grade: 1}
s2 = {name: '吊毛', age: 97, gender: Gender.Male, grade: 3}

console.log(s1)
console.log(s2)